<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>View all Transaction</title>
<script src="references/js/jquery-2.1.0.min.js"></script>
<script src="references/js/jquery.dataTables.js"></script>
<link href="references/css/jquery.dataTables.new.css" rel="stylesheet"
	type="text/css" />

</head>
<body>
	<tiles:insertTemplate template="/pages/masterpage/masterPage.jsp">
		<tiles:putAttribute name="body">
			<logic:notEqual name="role" value="Administrator">
				<logic:forward name="home" />
			</logic:notEqual>
			<div class="panel panel-success">
				<div class="panel-heading">
					<h3 class="panel-title">List All Transaction</h3>
				</div>
				<div class="panel-body">
					<table id="myTable" class="table">
						<thead>
							<tr>
								<th>Transaction ID</th>
								<th>App ID</th>
								<th>User ID</th>
								<th>Total</th>
								<th>Date Create</th>
								<th>Type</th>
								<th>Status</th>

								<th></th>
							</tr>
						</thead>
						<tbody>
							<logic:iterate id="listTrans" name="listTrans">
								<tr>
									<td><bean:write name="listTrans" property="transactionID" />
									</td>
									<td><bean:write name="listTrans" property="appID" /></td>
									<td><bean:write name="listTrans" property="userID" /></td>
									<td><bean:write name="listTrans" property="total" /></td>
									<td><bean:write name="listTrans" property="dateCreate" /></td>
									<td><logic:equal name="listTrans" property="type"
											value="0">
								Buy App
							</logic:equal> <logic:equal name="listTrans" property="type" value="2">
								Request money
							</logic:equal> <logic:equal name="listTrans" property="type" value="1">
								Deposit money
							</logic:equal></td>
									<td><logic:equal name="listTrans" property="status"
											value="1">
								Pending
							</logic:equal> <logic:equal name="listTrans" property="status" value="0">
								Processed
							</logic:equal></td>

									<td><logic:equal name="listTrans" property="type"
											value="2">
											<logic:equal name="listTrans" property="status" value="1">
												<html:link
													action="/changeTransactionStatus?transID=${listTrans.transactionID }">Change Status</html:link>
											</logic:equal>
											<logic:equal name="listTrans" property="status" value="0">
												<html:link
													action="/changeTransactionStatus1?transID=${listTrans.transactionID }">Change Status</html:link>
											</logic:equal>
										</logic:equal>
										</td>

								</tr>
							</logic:iterate>
						</tbody>
					</table>
				</div>
			</div>
<script>
jQuery.noConflict();
		$('#myTable').dataTable({
			"sPaginationType" : "full_numbers"

		});
</script>
		</tiles:putAttribute>
	</tiles:insertTemplate>




</body>
</html>